<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::any('/login/login', 'Admin\LoginController@login');
Route::any('/login/logout', 'Admin\LoginController@logout');
//系统管理
Route::group(['middleware'=>'admin','prefix' => 'system'],function(){
	Route::get('/base/index', 'Admin\BaseIndexController@index');
	Route::get('/user/index', 'Admin\UserController@index');
	
	Route::get('/config/index', 'Admin\ConfigController@index');
	Route::any('/config/edit', 'Admin\ConfigController@edit');
	
	Route::any('/admin/index', 'Admin\AdminController@index');
	Route::any('/admin/add', 'Admin\AdminController@add');
	Route::any('/admin/edit', 'Admin\AdminController@edit');
	Route::any('/admin/delete', 'Admin\AdminController@delete');
	
	Route::any('/banner/index', 'Admin\BannerController@index');
	Route::any('/banner/add', 'Admin\BannerController@add');
	Route::any('/banner/edit', 'Admin\BannerController@edit');
	Route::any('/banner/delete', 'Admin\BannerController@delete');
	Route::any('/banner/updown', 'Admin\BannerController@updown');
	Route::any('/banner/upload', 'Admin\BannerController@upload');
});

//产品管理
Route::group(['middleware'=>'admin','prefix' => 'product'],function(){
	
	Route::any('/goods/index', 'Admin\StoreGoodsController@index');
	Route::any('/goods/add', 'Admin\StoreGoodsController@add');
	Route::any('/goods/edit', 'Admin\StoreGoodsController@edit');
	Route::any('/goods/delete', 'Admin\StoreGoodsController@delete');
	Route::any('/goods/updown', 'Admin\StoreGoodsController@updown');
	Route::any('/goods/upload', 'Admin\StoreGoodsController@upload');
	Route::any('/goods/doctor', 'Admin\StoreGoodsController@doctor');
	Route::any('/goods/setCash', 'Admin\StoreGoodsController@setCash');
	
	Route::any('/cate/index', 'Admin\StoreCateController@index');
	Route::any('/cate/add', 'Admin\StoreCateController@add');
	Route::any('/cate/edit', 'Admin\StoreCateController@edit');
	Route::any('/cate/delete', 'Admin\StoreCateController@delete');
	Route::any('/cate/upload', 'Admin\StoreCateController@upload');
	
	Route::any('/style/index', 'Admin\StoreStyleController@index');
	Route::any('/style/add', 'Admin\StoreStyleController@add');
	Route::any('/style/edit', 'Admin\StoreStyleController@edit');
	Route::any('/style/delete', 'Admin\StoreStyleController@delete');
	
	Route::any('/order/index', 'Admin\StoreOrderController@index');
	Route::any('/order/status', 'Admin\StoreOrderController@status');
	Route::any('/order/delete', 'Admin\StoreOrderController@delete');
	Route::any('/order/upload', 'Admin\StoreOrderController@upload');
	Route::any('/order/detail', 'Admin\StoreOrderController@detail');
	
	Route::any('/comment/detail', 'Admin\StoreCommentController@detail');
});

//优惠码管理
Route::group(['middleware'=>'admin','prefix' => 'coupon'],function(){
	
	Route::any('/list/index', 'Admin\CouponListController@index');
	Route::any('/list/add', 'Admin\CouponListController@add');
	Route::any('/list/edit', 'Admin\CouponListController@edit');
	Route::any('/list/delete', 'Admin\CouponListController@delete');
	
	Route::any('/send/index', 'Admin\CouponSendController@index');
	Route::any('/send/add', 'Admin\CouponSendController@add');
	Route::any('/send/edit', 'Admin\CouponSendController@edit');
	Route::any('/send/delete', 'Admin\CouponSendController@delete');
	
});

//资讯管理
Route::group(['middleware'=>'admin','prefix' => 'article'],function(){
	
	Route::any('/cate/index', 'Admin\ArticleCateController@index');
	Route::any('/cate/add', 'Admin\ArticleCateController@add');
	Route::any('/cate/edit', 'Admin\ArticleCateController@edit');
	Route::any('/cate/delete', 'Admin\ArticleCateController@delete');
	Route::any('/cate/upload', 'Admin\ArticleCateController@upload');
	
	Route::any('/news/index', 'Admin\ArticleNewsController@index');
	Route::any('/news/add', 'Admin\ArticleNewsController@add');
	Route::any('/news/edit', 'Admin\ArticleNewsController@edit');
	Route::any('/news/delete', 'Admin\ArticleNewsController@delete');
	Route::any('/news/upload', 'Admin\ArticleNewsController@upload');		
});

//医生管理
Route::group(['middleware'=>'admin','prefix' => 'doctor'],function(){
	
	Route::any('/list/index', 'Admin\DoctorListController@index');
	Route::any('/list/add', 'Admin\DoctorListController@add');
	Route::any('/list/edit', 'Admin\DoctorListController@edit');
	Route::any('/list/delete', 'Admin\DoctorListController@delete');
	Route::any('/list/status', 'Admin\DoctorListController@status');
	
	Route::any('/cash/index', 'Admin\DoctorCashRecordController@index');
	Route::any('/cash/delete', 'Admin\DoctorCashRecordController@delete');
	
	Route::any('/withdraw/index', 'Admin\DoctorWithdrawApplyController@index');
	Route::any('/withdraw/status', 'Admin\DoctorWithdrawApplyController@status');
	Route::any('/withdraw/delete', 'Admin\DoctorWithdrawApplyController@delete');	
});

//API
Route::group(['middleware' => 'api','prefix' => 'api'],function(){
	Route::any('/getBannerList', 'Api\WxApp@getBannerList');
	
	Route::any('/getArticleCate', 'Api\WxApp@getArticleCate');
	Route::any('/getArticleList', 'Api\WxApp@getArticleList');
	Route::any('/paginateArticleList', 'Api\WxApp@paginateArticleList');
	Route::any('/getArticleDetail', 'Api\WxApp@getArticleDetail');
	
	Route::any('/getGoodsCate', 'Api\WxApp@getGoodsCate');
	Route::any('/paginateGoodsList', 'Api\WxApp@paginateGoodsList');
	Route::any('/getGoodsDetail', 'Api\WxApp@getGoodsDetail');
	Route::any('/recommendGoods', 'Api\WxApp@recommendGoods');
	Route::any('/searchGoods', 'Api\WxApp@searchGoods');
	
	Route::any('/confirmOrder', 'Api\WxApp@confirmOrder');
	Route::any('/addOrder', 'Api\WxApp@addOrder');
	Route::any('/wxPay', 'Api\WxApp@wxPay');
	Route::any('/notifyUrl', 'Api\WxApp@notifyUrl');
	Route::any('/paginateOrder', 'Api\WxApp@paginateOrder');
	Route::any('/setStatus', 'Api\WxApp@setStatus');
	Route::any('/userDeleteOrder', 'Api\WxApp@userDeleteOrder');
	Route::any('/getCouponCodeMoney', 'Api\WxApp@getCouponCodeMoney');
	
	
	Route::any('/insertAddress', 'Api\WxApp@insertAddress');
	Route::any('/updateAddress', 'Api\WxApp@updateAddress');
	Route::any('/getAddressList', 'Api\WxApp@getAddressList');
	Route::any('/getDetaultAddress', 'Api\WxApp@getDetaultAddress');
	Route::any('/setDefaultAddress', 'Api\WxApp@setDefaultAddress');
	
	Route::any('/getCartList', 'Api\WxApp@getCartList');
	Route::any('/insertCart', 'Api\WxApp@insertCart');
	Route::any('/deleteCart', 'Api\WxApp@deleteCart');
	Route::any('/updateCart', 'Api\WxApp@updateCart');
	
	Route::any('/addComment', 'Api\WxApp@addComment');
	Route::any('/getCommentList', 'Api\WxApp@getCommentList');
	
	Route::any('/addApplyDoctor', 'Api\WxApp@addApplyDoctor');
	Route::any('/getDoctorInfo', 'Api\WxApp@getDoctorInfo');
	Route::any('/paginateMyFans', 'Api\WxApp@paginateMyFans');
	Route::any('/paginateCashRecord', 'Api\WxApp@paginateCashRecord');
	Route::any('/withdrawApply', 'Api\WxApp@withdrawApply');
	
	Route::any('/sendSms', 'Api\WxApp@sendSms');
	Route::post('/upload', 'Api\WxApp@upload');
	Route::any('/getUserInfo', 'Api\WxApp@getUserInfo');
	Route::any('/getConfigInfo', 'Api\WxApp@getConfigInfo');
	Route::any('/getWxCode', 'Api\WxApp@getWxCode');
	Route::any('/authCode2Session', 'Api\WxApp@authCode2Session');
	Route::any('/getLoginUserInfo', 'Api\WxApp@getLoginUserInfo');

});
